home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / networking / amitcp / amitcp-bin-20.lha / AmiTCP-2.0 / doc / ftp.doc next >
Encoding:
Text File  |  1993-08-13  |  23.0 KB  |  527 lines

  1.  
  2. FTP(1C)                   USER COMMANDS                   FTP(1C)
  3.  
  4.  
  5. NAME
  6.      ftp - file transfer program
  7.  
  8. DESCRIPTION
  9.      ftp is the user  interface  to  the  ARPANET  standard  File
  10.      Transfer  Protocol (FTP).  ftp transfers files to and from a
  11.      remote network site.
  12.  
  13.      The client host with which ftp  is  to  communicate  may  be
  14.      specified on the command line.  If this is done, ftp immedi-
  15.      ately attempts to establish a connection to an FTP server on
  16.      that host; otherwise, ftp enters its command interpreter and
  17.      awaits instructions from the user.   When  ftp  is  awaiting
  18.      commands from the user, it displays the prompt `ftp>'.
  19.  
  20. AMIGA EXTENSIONS
  21.  
  22.      Since most of the users are already familiar with using FTP,
  23.      here are  the  extra options which have been  added  to this
  24.      port.  If  you  are unfamiliar with FTP, Jump to  `COMMANDS'
  25.      and return here when you have read it all.
  26.  
  27.      ftp <address> -L<filename> -U<uldir> -D<dldir> +
  28.     -H (plus standard options).
  29.  
  30.      -L  specifies a filename which to log byte counts and  sites
  31.      which have been connected to. There must be no space between
  32.      the 'L' and the  filename. The format of this file is simply
  33.      the name of the  site connected to, and  the number of bytes
  34.      transferred.
  35.  
  36.      -U  specifies  an "upload" directory. This is  the directory
  37.      which files are read from when using the 'put' command.
  38.  
  39.      -D specifies a "download" directory.  This is the  directory
  40.      which files are written to when using the 'get' command.
  41.  
  42.      -H turns hashing on by default.
  43.  
  44.      If these options are not specified, the current directory is
  45.      used, and no logging takes place.
  46.  
  47.      When viewing  a file, ftp  downloads the file as ".temp" and
  48.      views it with 'more'. If you wish to use a different command
  49.      (eg type), set this in the environment variable PAGER. Also,
  50.      the  previous directory listing  or file retrieved to stdout
  51.      can be viewed  again  with  the '!' command.   [There is  no
  52.      shell escape command].
  53.  
  54.      The mget and mput commands have also  been disabled. Most of
  55.      the file  globbing  has been disabled. Also, all get and put
  56.      commands work in the current directory only, even if a local
  57.      file is specified with a path.  Obviously allowing BBS users
  58.      to  write  to any directory  was not considered a  desirable
  59.      feature. If you wish to change this behaviour back, look for
  60.      calls to "basename()" in ftp.c.
  61.  
  62.      This  version  of FTP  can be used on  a BBS by constructing
  63.      scripts  which allow the  user to  upload  and download from
  64.      appropriate  directories.  Log  files  can be kept for later
  65.      charging. The pager command can be set to something which is
  66.      compatible with the BBS which is being used.
  67.      
  68. COMMANDS
  69.  
  70.      ! 
  71.           Redisplays the previous console output file (i.e. file
  72.           with a local name of `-' [or directory display])
  73.  
  74.      $ macro-name [ args ]
  75.           Execute the macro macro-name that was defined with  the
  76.           macdef  command.   Arguments  are  passed  to the macro
  77.           unglobbed.
  78.  
  79.      account [ passwd ]
  80.           Supply a supplemental password  required  by  a  remote
  81.           system  for  access  to resources once a login has been
  82.           successfully completed.  If no  argument  is  included,
  83.           the  user will be prompted for an account password in a
  84.           non-echoing input mode.
  85.  
  86.      append local-file [ remote-file ]
  87.           Append a local file to a file on  the  remote  machine.
  88.           If remote-file is left unspecified, the local file name
  89.           is used in naming the remote file after  being  altered
  90.           by  any ntrans or nmap setting.  File transfer uses the
  91.           current  settings  for  "representation  type",   "file
  92.           structure", and "transfer mode".
  93.  
  94.      ascii
  95.           Set the "representation type"  to  "network  "  ASCII".
  96.           This is the default type.
  97.  
  98.      bell Sound a bell after each file transfer command  is  com-
  99.           pleted.
  100.  
  101.      binary
  102.           Set the "representation type" to "image".
  103.  
  104.      bye  Terminate the FTP session with the  remote  server  and
  105.           exit  ftp.   An EOF will also terminate the session and
  106.           exit.
  107.  
  108.      case Toggle remote computer file name  case  mapping  during
  109.           mget  commands.   When  case  is  on  (default is off),
  110.           remote computer file names with all  letters  in  upper
  111.           case  are  written  in  the  local  directory  with the
  112.           letters mapped to lower case.
  113.  
  114.      cd remote-directory
  115.           Change the working directory on the remote  machine  to
  116.           remote-directory.
  117.  
  118.      cdup Change the remote  machine  working  directory  to  the
  119.           parent of the current remote machine working directory.
  120.  
  121.      close
  122.           Terminate the FTP session with the remote  server,  and
  123.           return  to the command interpreter.  Any defined macros
  124.           are erased.
  125.  
  126.      cr   Toggle RETURN stripping during "network "  ASCII"  type
  127.           file    retrieval.     Records   are   denoted   by   a
  128.           RETURN/LINEFEED sequence during "network " ASCII"  type
  129.           file  transfer.   When  cr  is on (the default), RETURN
  130.           characters are stripped from this sequence  to  conform
  131.           with  the UNIX system single LINEFEED record delimiter.
  132.           Records on non-UNIX-system  remote  hosts  may  contain
  133.           single  LINEFEED  characters; when an "network " ASCII"
  134.           type transfer is made, these LINEFEED characters may be
  135.           distinguished  from  a record delimiter only when cr is
  136.           off.
  137.  
  138.      delete remote-file
  139.           Delete the file remote-file on the remote machine.
  140.  
  141.      debug [ debug-value ]
  142.           Toggle debugging mode. If an  optional  debug-value  is
  143.           specified  it is used to set the debugging level.  When
  144.           debugging is on, ftp prints each command  sent  to  the
  145.           remote machine, preceded by the string `-->'.
  146.  
  147.      dir [ remote-directory ] [ local-file ]
  148.           Print a listing of the directory contents in the direc-
  149.           tory,  remote-directory,  and,  optionally, placing the
  150.           output in local-file.  If no  directory  is  specified,
  151.           the  current working directory on the remote machine is
  152.           used.  If no local file is specified, or local-file  is
  153.           `-', output is sent to the terminal.
  154.  
  155.      disconnect
  156.           A synonym for close.
  157.  
  158.      form [ format-name ]
  159.           Set  the  carriage  control  format  subtype   of   the
  160.           "representation  type"  to format-name.  The only valid
  161.           format-name is  non-print,  which  corresponds  to  the
  162.           default "non-print" subtype.
  163.  
  164.      get remote-file [ local-file ]
  165.           Retrieve the remote-file and  store  it  on  the  local
  166.           machine.   If  the local file name is not specified, it
  167.           is given the same name it has on  the  remote  machine,
  168.           subject  to alteration by the current case, ntrans, and
  169.           nmap settings.  The current settings  for  "representa-
  170.           tion  type",  "file structure", and "transfer mode" are
  171.           used while transferring the file.
  172.  
  173.      glob Toggle filename expansion, or "globbing", for  mdelete,
  174.           mget  and  mput.   If globbing is turned off, filenames
  175.           are taken literally.
  176.  
  177.           Globbing for mput is done as in  csh(1).   For  mdelete
  178.           and  mget, each remote file name is expanded separately
  179.           on the remote machine, and the lists are not merged.
  180.  
  181.           Expansion of a directory name is likely to be radically
  182.           different  from  expansion  of  the name of an ordinary
  183.           file: the exact result depends on the remote  operating
  184.           system  and  FTP  server, and can be previewed by doing
  185.           `mls remote-files -'.
  186.  
  187.           mget and mput are not meant to transfer  entire  direc-
  188.           tory  subtrees  of files.  You can do this by transfer-
  189.           ring  a  tar(1)  archive  of  the  subtree   (using   a
  190.           "representation  type"  of "image" as set by the binary
  191.           command).
  192.  
  193.      hash Toggle hash-sign  (#)  printing  for  each  data  block
  194.           transferred.
  195.  
  196.      help [ command ]
  197.           Print an informative message about the meaning of  com-
  198.           mand.   If  no  argument is given, ftp prints a list of
  199.           the known commands.
  200.  
  201.      ls [ remote-directory ] [ local-file ]
  202.           Print an abbreviated  listing  of  the  contents  of  a
  203.           directory  on  the remote machine.  If remote-directory
  204.           is left unspecified, the current working  directory  is
  205.           used.   If no local file is specified, or if local-file
  206.           is `-', the output is sent to the terminal.
  207.  
  208.      macdef macro-name
  209.           Define a macro.  Subsequent lines  are  stored  as  the
  210.           macro  macro-name;  a  null  line  (consecutive NEWLINE
  211.           characters in a file or RETURN characters from the ter-
  212.           minal)  terminates  macro input mode.  There is a limit
  213.           of 16 macros and 4096 total characters in  all  defined
  214.           macros.  Macros remain defined until a close command is
  215.           executed.
  216.  
  217.           The macro processor interprets `$' and `\'  as  special
  218.           characters.  A `$' followed by a number (or numbers) is
  219.           replaced by the corresponding  argument  on  the  macro
  220.           invocation  command  line.   A  `$'  followed by an `i'
  221.           signals that macro processor that the  executing  macro
  222.           is  to be looped. On the first pass `$i' is replaced by
  223.           the first argument  on  the  macro  invocation  command
  224.           line,  on  the second pass it is replaced by the second
  225.           argument, and so on.  A `\' followed by  any  character
  226.           is  replaced by that character.  Use the `\' to prevent
  227.           special treatment of the `$'.
  228.  
  229.      mdelete [ remote-files ]
  230.           Delete the remote-files on the remote machine.
  231.  
  232.      mdir remote-files local-file
  233.           Like dir, except multiple remote files  may  be  speci-
  234.           fied.   If interactive prompting is on, ftp will prompt
  235.           the user to verify that the last argument is indeed the
  236.           target local file for receiving mdir output.
  237.  
  238.      mkdir directory-name
  239.           Make a directory on the remote machine.
  240.  
  241.      mls remote-files local-file
  242.           Like ls(1V), except multiple remote files may be speci-
  243.           fied.   If interactive prompting is on, ftp will prompt
  244.           the user to verify that the last argument is indeed the
  245.           target local file for receiving mls output.
  246.  
  247.      mode [ mode-name ]
  248.           Set the "transfer mode" to mode-name.  The  only  valid
  249.           mode-name  is  stream, which corresponds to the default
  250.           "stream" mode.
  251.  
  252.  
  253.      nmap [ inpattern outpattern ]
  254.           Set or unset the filename  mapping  mechanism.   If  no
  255.           arguments are specified, the filename mapping mechanism
  256.           is unset.  If arguments are specified, remote filenames
  257.           are mapped during mput commands and put commands issued
  258.           without a specified remote target filename.   If  argu-
  259.           ments  are specified, local filenames are mapped during
  260.           mget commands and get commands issued without a  speci-
  261.           fied local target filename.
  262.  
  263.           This command is useful when connecting to  a  non-UNIX-
  264.           system  remote  host with different file naming conven-
  265.           tions or practices.  The mapping  follows  the  pattern
  266.           set  by  inpattern and outpattern.  inpattern is a tem-
  267.           plate for incoming filenames (which  may  have  already
  268.           been  processed  according  to the ntrans and case set-
  269.           tings).  Variable templating is accomplished by includ-
  270.           ing  the sequences $1, $2, ..., $9 in inpattern.  Use \
  271.           to prevent this special treatment of the  $  character.
  272.           All  other  characters  are  treated literally, and are
  273.           used to determine the nmap inpattern variable values.
  274.  
  275.           For example, given inpattern $1.$2 and the remote  file
  276.           name mydata.data, $1 would have the value "mydata", and
  277.           $2 would have the value "data".
  278.  
  279.           The  outpattern   determines   the   resulting   mapped
  280.           filename.   The  sequences $1, $2, ..., $9 are replaced
  281.           by any value resulting  from  the  inpattern  template.
  282.           The  sequence  $0 is replaced by the original filename.
  283.           Additionally, the sequence `[seq1,seq2]' is replaced by
  284.           seq1  if  seq1  is  not  a null string; otherwise it is
  285.           replaced by seq2.
  286.  
  287.           For    example,    the    command    `nmap     $1.$2.$3
  288.           [$1,$2].[$2,file]'  would  yield  the  output  filename
  289.           myfile.data  for  input   filenames   myfile.data   and
  290.           myfile.data.old,  myfile.file  for  the  input filename
  291.           myfile,  and  myfile.myfile  for  the  input   filename
  292.           .myfile.   SPACE  characters may be included in outpat-
  293.           tern, as in the example `nmap $1 |  sed  "s/   *$//"  >
  294.           $1'.   Use the \ character to prevent special treatment
  295.           of the `$', `[', `]' and `,' characters.
  296.  
  297.      ntrans [ inchars [ outchars ] ]
  298.           Set or unset the filename character translation mechan-
  299.           ism.  If no arguments are specified, the filename char-
  300.           acter translation mechanism is unset.  If arguments are
  301.           specified,   characters   in   remote   filenames   are
  302.           translated during mput commands and put commands issued
  303.           without a specified remote target filename, and charac-
  304.           ters in local  filenames  are  translated  during  mget
  305.           commands  and  get  commands issued without a specified
  306.           local target filename.
  307.  
  308.           This command is useful when connecting to  a  non-UNIX-
  309.           system  remote  host with different file naming conven-
  310.           tions or practices.  Characters in a filename  matching
  311.           a   character   in   inchars   are  replaced  with  the
  312.           corresponding   character   in   outchars.    If    the
  313.           character's  position  in  inchars  is  longer than the
  314.           length of outchars, the character is deleted  from  the
  315.           file name.
  316.  
  317.      open host [ port ]
  318.           Establish  a  connection  to  the  specified  host  FTP
  319.           server.   An  optional  port number may be supplied, in
  320.           which case, ftp will attempt to contact an  FTP  server
  321.           at   that   port.   If  the  auto-login  option  is  on
  322.           (default), ftp will also attempt to  automatically  log
  323.           the user in to the FTP server (see below).
  324.  
  325.      put local-file [ remote-file]
  326.           Store a local file on the remote machine.   If  remote-
  327.           file  is  left unspecified, the local file name is used
  328.           after processing according to any ntrans or  nmap  set-
  329.           tings  in  naming  the remote file.  File transfer uses
  330.           the current settings for "representation  type",  "file
  331.           structure", and "transfer mode".
  332.  
  333.      pwd  Print the name of the current working directory on  the
  334.           remote machine.
  335.  
  336.      quit A synonym for bye.
  337.  
  338.      quote arg1 arg2 ...
  339.           Send the arguments specified, verbatim, to  the  remote
  340.           FTP  server.   A  single  FTP reply code is expected in
  341.           return.
  342.  
  343.      recv remote-file [ local-file]
  344.           A synonym for get.
  345.  
  346.      remotehelp [ command-name ]
  347.           Request  help  from  the  remote  FTP  server.   If   a
  348.           command-name  is specified it is supplied to the server
  349.           as well.
  350.  
  351.      rename from to
  352.           Rename the file from on the remote machine to have  the
  353.           name to.
  354.  
  355.      reset
  356.           Clear  reply  queue.   This   command   re-synchronizes
  357.           command/reply  sequencing  with  the remote FTP server.
  358.           Resynchronization may be necessary following  a  viola-
  359.           tion of the FTP protocol by the remote server.
  360.  
  361.      rmdir directory-name
  362.           Delete a directory on the remote machine.
  363.  
  364.      runique
  365.           Toggle storing of files on the local system with unique
  366.           filenames.   If a file already exists with a name equal
  367.           to the target local filename for a get or mget command,
  368.           a  `.1' is appended to the name.  If the resulting name
  369.           matches another existing file, a `.2'  is  appended  to
  370.           the  original  name.   If  this process continues up to
  371.           `.99', an error message is printed,  and  the  transfer
  372.           does  not  take  place.   The generated unique filename
  373.           will be reported.  Note: runique will not affect  local
  374.           files  generated from a shell command (see below).  The
  375.           default value is off.
  376.  
  377.      send local-file [ remote-file ]
  378.           A synonym for put.
  379.  
  380.      sendport
  381.           Toggle the use of PORT commands.  By default, ftp  will
  382.           attempt  to use a PORT command when establishing a con-
  383.           nection for each data transfer.  The use of  PORT  com-
  384.           mands  can prevent delays when performing multiple file
  385.           transfers. If the PORT command fails, ftp will use  the
  386.           default  data  port.  When  the use of PORT commands is
  387.           disabled, no attempt will be made to use PORT  commands
  388.           for  each data transfer.  This is useful when connected
  389.           to certain FTP implementations that  ignore  PORT  com-
  390.           mands but incorrectly indicate they have been accepted.
  391.  
  392.      status
  393.           Show the current status of ftp.
  394.  
  395.      struct [ struct-name ]
  396.           Set the "file  structure"  to  struct-name.   The  only
  397.           valid  struct-name  is  file,  which corresponds to the
  398.           default "file" structure.
  399.  
  400.      sunique
  401.           Toggle storing of files on remote machine under  unique
  402.           file  names.   The  remote  FTP server must support the
  403.           STOU command for  successful  completion.   The  remote
  404.           server  will  report the unique name.  Default value is
  405.           off.
  406.  
  407.      trace
  408.           Toggle packet tracing (unimplemented).
  409.  
  410.      type [ type-name ]
  411.           Set the "representation type" to type-name.  The  valid
  412.           type-names  are  ascii for "network " ASCII", binary or
  413.           image for "image", and tenex for "local byte size" with
  414.           a  byte size of 8 (used to talk to TENEX machines).  If
  415.           no type is specified, the current type is printed.  The
  416.           default type is "network " ASCII".
  417.  
  418.      user user-name [ password ] [ account ]
  419.           Identify yourself to the  remote  FTP  server.  If  the
  420.           password  is  not specified and the server requires it,
  421.           ftp will prompt the user for it (after disabling  local
  422.           echo).   If  an account field is not specified, and the
  423.           FTP server requires it, the user will be  prompted  for
  424.           it.   If  an  account  field  is  specified, an account
  425.           command will be relayed to the remote server after  the
  426.           login  sequence  is  completed if the remote server did
  427.           not require it for logging in.  Unless ftp  is  invoked
  428.           with   "auto-login"  disabled,  this  process  is  done
  429.           automatically on initial connection to the FTP server.
  430.  
  431.      verbose
  432.           Toggle verbose mode.  In verbose  mode,  all  responses
  433.           from  the  FTP  server  are  displayed to the user.  In
  434.           addition, if verbose mode is on, when a  file  transfer
  435.           completes,  statistics  regarding the efficiency of the
  436.           transfer are reported. By default, verbose mode  is  on
  437.           if  ftp's  commands are coming from a terminal, and off
  438.           otherwise.
  439.  
  440.      ? [ command ]
  441.           A synonym for help.
  442.  
  443.      Command arguments which have embedded spaces may  be  quoted
  444.      with quote (") marks.
  445.  
  446.      If any command argument which  is  not  indicated  as  being
  447.      optional  is  not  specified, ftp will prompt for that argu-
  448.      ment.
  449.  
  450. ABORTING A FILE TRANSFER
  451.      To abort a file transfer, press any  key. Sending  transfers
  452.      will  be immediately halted.  
  453.  
  454.      Receiving transfers will be halted by sending a ftp protocol
  455.      ABOR  command  to  the  remote  server, and  discarding  any 
  456.      further  data   received.   The  speed  at   which  this  is
  457.      accomplished  depends  upon  the remote server's support for
  458.      ABOR processing.  If the remote server does not support  the
  459.      ABOR  command,  an  "ftp>"  prompt will not appear until the
  460.      remote server has completed sending the requested file.
  461.  
  462.      The terminal interrupt key sequence will be ignored when ftp
  463.      has  completed  any local processing and is awaiting a reply
  464.      from the remote server.  A  long  delay  in  this  mode  may
  465.      result  from  the  ABOR  processing described above, or from
  466.      unexpected behavior by the remote server,  including  viola-
  467.      tions  of the ftp protocol.  If the delay results from unex-
  468.      pected remote server behavior, the local ftp program must be
  469.      killed by hand.
  470.  
  471. FILE NAMING CONVENTIONS
  472.      Local files specified as arguments to ftp commands are  pro-
  473.      cessed according to the following rules.
  474.  
  475.      1)   If the file name `-' is specified, the  standard  input
  476.           (for reading) or standard output (for writing) is used.
  477.       When `-' is specified for the output in the Amiga
  478.           version, the data is written to a file called '.temp',
  479.           This is done so that the '!' [redisplay] command can be
  480.           used. FTP does not delete this file.
  481.  
  482.      2)   For get commands with unspecified local file names, the
  483.       local  filename is the remote  filename, which  may  be 
  484.       altered  by  a  case,  ntrans,  or  nmap  setting.  The 
  485.       resulting filename may then be altered if runique is on.
  486.  
  487.      3)   For put commands with unspecified  remote  file  names, 
  488.       the remote filename is the local filename, which may be
  489.       altered by a ntrans  or  nmap  setting.  The  resulting
  490.       filename may then be altered by the  remote  server  if
  491.       sunique is on.
  492.  
  493. FILE TRANSFER PARAMETERS
  494.      The FTP specification specifies many  parameters  which  may
  495.      affect a file transfer.
  496.  
  497.      The "representation type" may be one of "network  "  ASCII",
  498.      "EBCDIC",  "image",  or  "local  byte size" with a specified
  499.      byte size (for PDP-10's and PDP-20's mostly).  The  "network
  500.      "  ASCII"  and  "EBCDIC"  types have a further subtype which
  501.      specifies whether vertical format control  (NEWLINE  charac-
  502.      ters,  form  feeds,  etc.)  are  to be passed through ("non-
  503.      print"), provided in  TELNET  format  ("TELNET  format  con-
  504.      trols"),  or  provided  in  ASA (FORTRAN) ("carriage control
  505.      (ASA)") format.  ftp supports the "network " ASCII" (subtype
  506.      "non-print"  only) and "image" types, plus "local byte size"
  507.      with a byte size of 8 for communicating with TENEX machines.
  508.  
  509.      The "file structure" may be one of "file" (no record  struc-
  510.      ture),  "record",  or "page".  ftp supports only the default
  511.      value, which is "file".
  512.  
  513.      The "transfer mode" may be  one  of  "stream",  "block",  or
  514.      "compressed".  ftp supports only the default value, which is
  515.      "stream".
  516.  
  517. BUGS
  518.      Correct execution  of  many  commands  depends  upon  proper
  519.      behavior by the remote server.
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.